<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->

<title>vidattr</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_002_001_144">&nbsp;</a>NAME</h4><blockquote>
vidattr, vid_attr, vidputs, vid_puts - output attributes to the terminal
</blockquote><h4><a name = "tag_002_001_145">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="curses.h.html">curses.h</a>&gt;

int vidattr(chtype <i>attr</i>);

int vid_attr(attr_t <i>attr</i>, short <i>color_pair_number</i>, void <i>*opt</i>);

int vidputs(chtype <i>attr</i>, int (*<i>putfunc</i>)(int));

int vid_puts(attr_t <i>attr</i>, short <i>color_pair_number</i>, void <i>*opt</i>, int
<br>
            (*<i>putfunc</i>)(int));
</code>
</pre>
</blockquote><h4><a name = "tag_002_001_146">&nbsp;</a>DESCRIPTION</h4><blockquote>
These functions output commands to the terminal that change the terminal's
attributes.
<p>
If the <b>terminfo</b> database indicates that the terminal in use can display
characters in the rendition specified by <i>attr</i>, then
<i>vidattr()</i>
outputs one or more commands to request that the terminal display subsequent
characters in that rendition.  The function outputs by calling
<i><a href="../xsh/putchar.html">putchar()</a></i>.
The
<i>vidattr()</i>
function neither relies on nor updates the model which Curses
maintains of the prior rendition mode.
<p>
The
<i>vidputs()</i>
function computes the same terminal output string that
<i>vidattr()</i>
does, based on <i>attr</i>, but
<i>vidputs()</i>
outputs by calling the user-supplied function
<i>putfunc</i>.
The
<i>vid_attr()</i>
and
<i>vid_puts()</i>
functions correspond to
<i>vidattr()</i>
and
<i>vidputs()</i>
respectively, but take a set of
arguments, one of type
<b>attr_t</b>
for the	attributes, short for
the colour pair number and a void *, and thus support the
attribute constants with the WA_ prefix.
<p>
The opts argument is reserved for definition in a future
edition of this document. Currently, the application must
provide a null pointer as opts.
<p>
The user-supplied function
<i>putfunc</i>
(which can be specified as an argument to either
<i>vidputs()</i>
or
<i>vid_puts()</i>)
is either
<i><a href="../xsh/putchar.html">putchar()</a></i>
or some other function with the same prototype.  Both the
<i>vidputs()</i>
and the
<i>vid_puts()</i>
function ignore the return value of
<i>putfunc</i>.
</blockquote><h4><a name = "tag_002_001_147">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion, these functions return OK.
Otherwise, they return ERR.
</blockquote><h4><a name = "tag_002_001_148">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_002_001_149">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
After use of any of these functions, the model Curses
maintains of the state of the terminal might not match the actual state of the
terminal.  The application should touch and refresh the window before resuming
conventional use of Curses.
<p>
Use of these functions requires that the application contain so much
information about a particular class of terminal that it defeats the purpose
of using Curses.
<p>
On some terminals, a command to change rendition conceptually occupies space
in the screen buffer (with or without width).  Thus, a command to set the
terminal to a new rendition would change the rendition of some characters
already displayed.
</blockquote><h4><a name = "tag_002_001_150">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="doupdate.html">doupdate()</a></i>,
<i><a href="is_linetouched.html">is_linetouched()</a></i>,
<i><a href="../xsh/putchar.html">putchar()</a></i>
(in the <b>XSH</b> specification),
<i><a href="../xsh/putwchar.html">putwchar()</a></i>
(in the <b>XSH</b> specification),
<i><a href="tigetflag.html">tigetflag()</a></i>,
<i><a href="curses.h.html">&lt;curses.h&gt;</a></i>.
<br>
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
